#ifndef FILESHARE_H_
#define FILESHARE_H_

#include "SharedFileList.h"
#include "lib/Bitmap.h"

#include <string>

class FileShare {

private:
	int myUserID;

	int readSharedFiles(LockFile &shared, SharedFileList &list, int userID, bool showAll=false);

public:

	/*
	 * myID: my user ID (process id of the process that wants to share the file)
	 *
	 * */

	FileShare(int myID);

	virtual ~FileShare();

	int shareFile(std::string &path);

	int unshareFile(std::string &path);

	int getMySharedFiles(SharedFileList &list, bool showAll=false);

	int getAllSharedFiles(SharedFileList &list, bool ignoreMine = false);

	int getSharedFiles(int userID, SharedFileList &list, bool showAll=false);

	/*
	 * returns the number of the shared file
	 * if file not found returns -1
	 * */
	int findMySharedFile(std::string &path, bool showAll=false);

};

#endif /* FILESHARE_H_ */
